SD card driver for the Atari STe extended Joystick Port A

Driver v1.2b by OrionSoft 2020
http://orionsoft.free.fr/

GPL source included, you can assemble it using DevPac or Vasmm68k -devpac -Ftos -o sdextjoy.prg sdextjoy.s

This driver will hook up to the Xbios hard disk drive routines to simulate a GEMDOS drive showing the content of an SD Card.
So you can read and write the SD card from the GEM desktop.

This driver will let the TOS process the file system, so you will be restricted to TOS limits with a FAT16 file system of less than 32 Mbytes.
If you want to use a bigger partition on your SD card up to 2Gbytes, you need to start the utility "bigdos.prg" before the SD driver.

How to setup your SD card:
Create up to 4 partitions of type "primary" on your SD card.
Each partition must be 32Mbytes maximum and formated using the FAT16 file system. (or 2Gbytes if you use "bigdos")

How to make the SD card adapter:
You will need an SD card breakout board compatible with 5 volts input.
You will also need 6 female-to-male pin wires.

Wire the SD card breakout board to the Extended Joystick Port A of your Atari STe/Falcon using this schematics:

Extended Joystick Port: Computer Side
    _______________________________
    \   5   4    3    2    1      /
     \     10   9    8    7   6  /
      \ 15  14   13  12   11    /
       \_______________________/

Joystick Port Pin | SD card breakout board Pin
                4 - MOSI
                3 - SCK
                2 - CS
                6 - MISO
                7 - VCC
                9 - GND

The speed of this driver on a standard Atari STe 8mhz is about 20kbytes/s.
It's not possible to go higher than 26kbytes/s due to the fact that we retrieve the data from the SD card bit per bit.

The driver was tested on Atari STe only, I don't know if it will work on a Falcon as I don't have one.
This driver is given to you for free, despite the fact that it took me several weeks to create.
Any donation is appreciated to show some support: https://www.paypal.me/orionsoft42
so maybe I can get enough money to buy a Falcon :)

Thanks to:
Zerosquare for the Original Idea and Help.
Jens-Uwe Mager for his ramdisk source code that help me understand xbios hard disk drive hookup.
The EmuTOS team for the EmuTOS source code who help me understand the TOS Bios Parameter Block.
Dan Hollis for his Atari ST Hardware Register Listing.
Paradox for their STE_SPEC documentation about the extended joystick port.
The Steem emulator team for their awesome Atari STe debugger.
ZeroPlus for their great logic analyser.
